<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class ChangeGpsadvUsers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('gpsadv_users');
        Schema::create('gpsadv_users', function (Blueprint $table) {
            $table->increments('id')->comment('ID');
            $table->string('user_client_id', 400)->default('')->comment('手机用户客户端ID');
            $table->tinyInteger('status')->default(2)->comment('状态:0-注销,1-有效,2-停用$radio@nullable|in:0,1,2');
            $table->string('android_id', 16)->default('')->index()->comment('安卓id@sometimes|required|android_id|unique:users,android_id');
            $table->timestamps();
            $table->softDeletes();
            //设置表备注
            $table->charset = config('database.connections.'.config('database.default').'.charset').
                ' COMMENT="手机用户$softDeletes,timestamps"';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('gpsadv_users');
    }
}
